package com.hashnode.service;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.stereotype.Service;

@Service
public class TestSentinelService {

    @SentinelResource(value = "testSentinelService",blockHandler = "handleException")
    public String testSentinelService(){
        return "sentService";
    }

    public String handleException(BlockException exception){
        return exception.getClass().getCanonicalName() + "\t服务不可用";
    }
}
